const h1 = document.querySelector("h1");

h1.addEventListener("input", function () {
  this.setAttribute("data-heading", this.innerText);
});

window.addEventListener("keydown", function (e) {
  if (
    e.key == "Enter" ||
    e.keyIdentifier == "U+000A" ||
    e.keyIdentifier == "Enter"
  ) {
    e.preventDefault();
    return false;
  }
});
